package mymaggi.serienjunkiesmonitor;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;

import org.apache.log4j.Logger;

public class GetShows {
	
	private static Logger logger = Logger.getRootLogger();
	private static String file;
	
	public GetShows(String datei){
		file = datei;
	}
	
	public List<String> readShows() throws IOException{
		logger.debug("Shows werden aus Datei eingelesen.");
		List<String> liste = new LinkedList<String>();
		File f = new File(file);
		FileReader r = new FileReader(f);
		BufferedReader out = new BufferedReader(r);
		String line = out.readLine();
		while(line!=null){
			liste.add(line);
			line=out.readLine();
		}
		out.close();
		logger.debug("Shows wurden eingelesen.");
		
		return liste;
	}

}
